#ifndef USERCENTERDAO_H
#define USERCENTERDAO_H
#include "mysqlPool.h"
#include "SingleClass.h"
#include "../rpc_src/message.pb.h"
#include "../rpc_src/message.grpc.pb.h"
#include "../include/SingleClass.h"


//逻辑调用

//逻辑调用也做成单例类，毕竟grpc服务端可能多个线程调用服务函数
class userCenterDao:public SingleClass<userCenterDao>{

public:
    //注册用户
    bool register_user(const ::message::reqRegisterUser* request, ::message::resRegisterUser* response);   
    //重置密码
    bool reset_passwd(const ::message::reqResetPasswd* request, ::message::resResetPasswd* response);
    //登陆请求
    bool login(const ::message::reqLogin* request, ::message::resLogin* response);
    ~userCenterDao(){
        std::cout<<"userCenterDao 成功释放掉"<<std::endl;
    }
private:
    friend class SingleClass<userCenterDao>;
    userCenterDao();
    mysqlPool userCenterDaoPool;    //mysql连接池不对外暴露，由内部函数调用处理
    
};



#endif